
-----------------------------------------------
--  判断能否加入某职业
-- @param  pet      宠物
-- @param  careerId 职业id
return function(pet, careerId)
    -- 如果不是在地牢中
    if not DungeonM.isInDungeon() then
        return false;
    end

    local info = CareerM.getCareerInfo(careerId);
    local dungeonId = DungeonM.getDungeonId();
    if type(dungeonId) == "number" and dungeonId > 0 then
        -- 玩家在无尽模式中可直接学习,小关判断一下阶位限制
        if DungeonAreaM.query(dungeonId, "type") ~= "child" then
            return true;
        elseif DungeonAreaM.query(dungeonId, "max_career_rank") < info["rank"] then
            return false
        end
    end

    dungeonId = info["dungeon"];
    if type(dungeonId) == "number" and dungeonId > 0 then
        -- 判断是否已经开启了该副本
        if not DungeonAreaM.isSubAreaUnlocked(ME.user, dungeonId) then
            return string.format(getLocStr("in_low_dungeon"), info.name);
        end
    end

    return true;
end
